package com.springboot4layui.boot01.controller;

import com.springboot4layui.boot01.service.ProductService;
import com.springboot4layui.boot01.vo.DataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
public class ProductController {

    @Autowired
    private ProductService productService;

    @RequestMapping("/list")
    public DataVO list(Integer page,Integer limit){
        System.out.println("page = " + page + ", limit = " + limit);
        return productService.findData(page,limit);
    }
}
